<?php

class Controller_Page extends Controller_Base {

	private $_request = array();
	private $_url = '';

	public function before()
	{
		parent::before();
		$this->_url = $this->request->param('url');
		$default_page_id = $this->colibri->setting->get('default_page_id');
		$this->_request = $this->colibri->page->request($this->_url, $default_page_id);
		$tree = $this->colibri->page->tree();
		View::set_global('tree',$tree);

	}

	public function action_index()
	{
        $this->template->menu = View::factory('/module/menu.tpl');
		$this->template->page = $this->_request;
		$page = View::factory('page/'.$this->_request['template']);
		$this->template->content = $page;
	}



}